<!DOCTYPE html>
<html>
<!--Made By kailuosoft.com, TEL 171 9992 9517 --><head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<style>
    	.width{
				width:50px;			
			}
		.black_overlay{  display: none;  position: absolute;  top: 0%;  left: 0%;  width: 100%;  height: 100%;  background-color: black;  z-index:1001;  -moz-opacity: 0.8;  opacity:.80;  filter: alpha(opacity=80);  }  
		.white_content {  display: none;  position: absolute;  top: 25%;  left: 40%;  width: 30%;  height: 50%;  padding: 16px;   background-color: white;  z-index:1002;  overflow: auto;  } 
	
		
    </style>
	<title>凯络科技后台管理系统</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <!--<link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">-->
    <link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="__PUBLIC__/css/page.css" rel="stylesheet">
    <link href="__PUBLIC__/css/new.css" rel="stylesheet">
	
    
    
    <script src="__PUBLIC__/js/jquery.min63b9.js?v=2.1.4"></script>
    <script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
    <script src="__PUBLIC__/js/bootstrap.min14ed.js?v=3.3.6"></script>
    <script src="__PUBLIC__/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="__PUBLIC__/js/content.mine209.js?v=1.0.0"></script>
    <script src="__PUBLIC__/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/js/demo/peity-demo.min.js"></script>
	<script src="__PUBLIC__/js/plugins/layer/laydate/laydate.js"></script>
    
    <script src="__PUBLIC__/template_files/LodopFuncs.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

   <script type="text/javascript">
		function page(n,s){
			var outer_iid=$('#outer_iid').val();
			var tid=$('#tid').val();
			var receiver_name=$('#receiver_name').val();
			var shifa=$('#shifa').val();
			var seller_flag=$('#seller_flag').val();
			
			var shoptitle=$('#shoptitle').val();
			var starttime=$('#starttime').val();
			var endtime=$('#endtime').val();
			var name=$('#name').val();
			var asc=$('#asc').val();
			var kuaidi1=$('#kuaidi1').val();
			var kuaidi2=$('#kuaidi2').val();
			var asc_sort=$('#asc_sort').val();
			location.href='print_order?pageNo='+n+'&pageSize='+s+'&shoptitle='+shoptitle+'&kuaidi1='+kuaidi1+'&kuaidi2='+kuaidi2+'&asc_sort='+asc_sort+'&starttime='+starttime+'&endtime='+endtime+'&name='+name+'&asc='+asc+'&outer_iid='+outer_iid+'&shifa='+shifa+'&seller_flag='+seller_flag+'&tid='+tid+'&receiver_name='+receiver_name;
	    	return false;
	    }
		
		/*function dele(id)
		{
		    layer.confirm('确定要删除吗？',
			              {btn:['确定','取消']},
							  function(){
							      location.href="/asptp/index.php/home/customer/customer_delete/id/"+id
							  }
						  ),
						
						  function(){return false;} 
						  
		}
		
		function list_sort(name){
			if($('#asc').val()=='asc'){
				var asc='desc';
			}else{
				var asc='asc'; 
			}
			var title=$('#title').val();
			var phone=$('#phone').val();
			var orderno=$('#orderno').val();
			//location.href='find?pageNo='+{$count.pageNo}+'&pageSize='+{$count.pageSize}+'&title='+title+'&phone='+phone+'&orderno='+orderno+'&name='+name+'&asc='+asc;
		}*/
		
		$(document).ready(function(){
			
			$('.edit').dblclick(function(){
			name=$(this).attr('nameval');
			nval=$(this).text();
			oid=$(this).parent().find('.oid').val();
				
			$(this).parent().find('.invoice_no').attr('name','invoice_no');
			$(this).parent().find('.tid').attr('name','tid');
			$(this).html("<input type='text' name='"+name+"' value='"+nval+"' class='input-sm form-control' class='nameedit'>");
			$(this).children().focus().val(nval);
				 
			$(this).children().blur(function(event){
				$.ajax({
					url:"{:U('edit_invoice_no')}",    //请求的url地址
					dataType:"json",   //返回格式为script
					data:{"invoice_no":nval,"oid":oid},    //参数值
					type:"POST",   //请求方式
					success:function(res){
						//window.location.reload(true);
					}
				});
		    }) ;
		 
		 });	
		
		 $('.receiver').click(function(){
			   tid=$(this).parents('tr').find('.tid').val();
			   layer.open({ 
					type: 2,
					shift:5,
					title: ['修改收件信息','font-size:18px;'],
					shadeClose: true,
					shade: false, 
					maxmin: false, //开启最大化最小化按钮
					area: ['650px', '350px'],
					content: ["{:U('order_receiver')}?tid="+tid,'no'], //iframe的url，no代表不显示滚动条
					btn: ['确定', '取消'],
					yes: function(index, layero){
						      receiverform=layer.getChildFrame('#receiverform');
						      receiverform.submit();
						 },
					success:function(){
						
					 }
					
				 });
		  })	
		  
		  $('.memo').click(function(){
			   tid=$(this).parents('tr').find('.tid').val();
			   layer.open({ 
					type: 2,
					shift:5,
					title: ['修改标旗备注','font-size:18px;'],
					shadeClose: true,
					shade: false, 
					maxmin: false, //开启最大化最小化按钮
					area: ['500px', '300px'],
					content: ["{:U('order_memo')}?tid="+tid,'no'], //iframe的url，no代表不显示滚动条
					btn: ['确定', '取消'],
					yes: function(index, layero){
						      receiverform=layer.getChildFrame('#memoform');
						      receiverform.submit();
						 },
					success:function(){
						
					 }
					
				 });
		  })	
		  
		  
		  $('.merge').click(function(e){
			   e.stopPropagation();
			   tid=$(this).parents('tr').find('.tid').val();
			   layer.open({ 
					type: 2,
					shift:5,
					title: ['订单合并管理','font-size:18px;'],
					shadeClose: true,
					shade: false, 
					maxmin: false, //开启最大化最小化按钮
					area: ['1000px', '500px'],
					content: ["{:U('order_merge')}?tid="+tid,'no'], //iframe的url，no代表不显示滚动条
					btn: ['合并', '取消'],
					yes: function(index, layero){
						      checks=layer.getChildFrame('.i-checks');
							  oids='';
							  tids='';
							  checks.each(function(){
								     if($(this).prop('checked'))
									 {   
									     oid_count=$(this).attr('total_count');
										 oid_start=$(this).parents('tbody').find('.oid').index($(this).parents('tr').find('.oid'));
										 oid_end=parseInt(oid_start)+parseInt(oid_count);
										 for(i=oid_start;i<oid_end;i++)
										 { 
											oids+=$(this).parents('tbody').find('.oid').eq(i).val()+',';
										 }
										 
										 tid_count=$(this).attr('trades_count');
										 tid_start=$(this).parents('tbody').find('.tid').index($(this).parents('tr').find('.tid'));
										 tid_end=parseInt(tid_start)+parseInt(tid_count);
										 for(i=tid_start;i<tid_end;i++)
										 {
											tids+=$(this).parents('tbody').find('.tid').eq(i).val()+','; 
										 }
									 } 
								})
								
							   if(tids=='')
							   {
								   layer.alert('请至少选择2个订单');
								   return false;
							   }
							    
						       arr=tids.split(",");
							   if(arr.length<3)
							   {
								   layer.alert('请至少选择2个订单');
								   return false;
							   }   
							 
							 layer.getChildFrame('#tids').val(tids);
							 layer.getChildFrame('#oids').val(oids);
							 layer.getChildFrame('#mergeform').submit();  
						 },
					success:function(){
						
					 }
					
				 });
		  })	
		  	
		  $('.split').click(function(e){
			   e.stopPropagation();
			   tid=$(this).parents('tr').find('.tid').val();
			   oid=$(this).parents('tr').find('.oid').val();
			   layer.open({ 
					type: 2,
					shift:5,
					title: ['订单拆分管理','font-size:18px;'],
					shadeClose: true,
					shade: false, 
					maxmin: false, //开启最大化最小化按钮
					area: ['1000px', '500px'],
					content: ["{:U('order_split')}?tid="+tid+"&oid="+oid,'no'], //iframe的url，no代表不显示滚动条
					btn: ['拆分', '取消'],
					yes: function(index, layero){
							  checks=layer.getChildFrame('.i-checks');
							  tids='';
							  oids='';
							  checks.each(function(){
									if($(this).prop('checked'))
									 {   
									     tids=$(this).parents('tr').find('.tid').val();
										 
										 oid_count=$(this).attr('orders_count');
										 oid_start=$(this).parents('tbody').find('.oid').index($(this).parents('tr').find('.oid'));
										 oid_end=parseInt(oid_start)+parseInt(oid_count);
										 for(i=oid_start;i<oid_end;i++)
										 { 
											oids+=$(this).parents('tbody').find('.oid').eq(i).val()+',';
										 }
									 }
								})
								
							   if(tids=='')
							   {
								   layer.alert('请至少选择1个订单');
								   return false;
							   }
								
							 
							 layer.getChildFrame('#tids').val(tids);
							 layer.getChildFrame('#oids').val(oids);
							 layer.getChildFrame('#mergeform').attr('action','order_split_edit');  
							 layer.getChildFrame('#mergeform').submit();  
						 },
					success:function(){
						
					 }  
					
				 });
		 })	

		   	
		 $('.part_split').click(function(e){
			   e.stopPropagation();
			   tid=$(this).parents('tr').find('.tid').val();
			   layer.open({ 
					type: 2,
					shift:5,
					title: ['子订单拆分管理','font-size:18px;'],
					shadeClose: true,
					shade: false, 
					maxmin: false, //开启最大化最小化按钮
					area: ['1000px', '500px'],
					content: ["{:U('order_part_split')}?tid="+tid,'no'], //iframe的url，no代表不显示滚动条
					btn: ['拆分', '取消'],
					yes: function(index, layero){
						      checks=layer.getChildFrame('.i-checks');
							  oids='';
							  checks.each(function(){
								     if($(this).prop('checked'))
									 {   
									     oids+=$(this).val()+',';
									 }
								})
								
							   if(oids=='')
							   {
								   layer.alert('请至少选择1个订单');
								   return false;
							   }
							    
							  
							 layer.getChildFrame('#oids').val(oids);
							 layer.getChildFrame('#splitform').attr('action','order_part_split_edit');  
							 layer.getChildFrame('#splitform').submit();  
						 },
					success:function(){
						
					 }
					
				 });
		  })
		  
		  			
		 
	   })
	</script>
    

</head>

<body class="gray-bg"> 
    <div class="wrapper wrapper-content animated fadeInRight">
         
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>订单打印</h5>
                    </div>
                    <div class="ibox-content">
					     <form id="searchForm" class="form-inline" method="post" action="{:U('print_order')}" >
					<div class="row">
                            <input type='hidden' name='pageNo' value='1' />
                            <input type='hidden' name='pageSize' value='10' />
                            <input type='hidden' id='name' name='name' value='{$order.name}' />
                            <input type='hidden' id='asc' name='asc' value='{$order.asc}' />
                            
                            <div class='search'>
                               <!--<select name='shoptitle' class="form-control input-sm" id='shoptitle' style='margin-top:-5px;padding-top:0px'>
                                   <option value='0'>店铺</option>
                                   <foreach name="shop_list" item="shop" >
                                   <option <?php echo $shop['shop_name']==$data['shoptitle']?'selected':''; ?> >{$shop.shop_name}</option>
                                   </foreach>
                               </select> -->
                               
                              <!-- <select name='status' class="form-control input-sm" id='shoptitle' style='margin-top:-5px;padding-top:0px'>
                                   <option value='all'>所有订单</option>
                                   <option <?php echo $data['status']=='WAIT_SELLER_SEND_GOODS'?'selected':''; ?> value='WAIT_SELLER_SEND_GOODS' >待发货</option>
                                   <option <?php echo $data['status']=='WAIT_BUYER_CONFIRM_GOODS'?'selected':''; ?> value='WAIT_BUYER_CONFIRM_GOODS' >已发货</option>
                               </select> 
                               
                               <!--<input class="form-control input-sm" placeholder="开始时间" name="starttime" id="starttime" onClick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value="<?php echo empty($data['starttime'])?'':$data['starttime']; ?>" >
							   
							   <input class="form-control input-sm" placeholder="结束时间" name="endtime" id="endtime" onClick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value="<?php echo empty($data['endtime'])?'':$data['endtime']; ?>" >-->
							   
							   <!--  <input class="form-control input-sm" placeholder="产品编码" name="outer_iid" id="outer_iid" value="<?php echo empty($data['outer_iid'])?'':$data['outer_iid']; ?>">
                                 
                                 <input type="text" placeholder="订单号" name='tid' id='tid' class="input-sm form-control" value='{$data.tid}'> 
                                
                                <input type="text" placeholder="客户姓名" name='receiver_name' id='receiver_name' class="input-sm form-control" value='{$data.receiver_name}'>  
								 <input class="form-control input-sm" placeholder="实发" name="shifa" id="shifa" value="<?php echo empty($data['shifa'])?'':$data['shifa']; ?>">
                                 
								 <select name='seller_flag' class="form-control input-sm" id='seller_flag' style='margin-top:-5px;padding-top:0px'>
                                   <option value='all'>旗帜</option>
                                   <option value="1" <?php echo "1"==$data['seller_flag']?'selected':''; ?>>红</option>
                                   <option value="2" <?php echo "2"==$data['seller_flag']?'selected':''; ?>>黄</option>
								   <option value="3" <?php echo "3"==$data['seller_flag']?'selected':''; ?>>绿</option>
                                   <option value="4" <?php echo "4"==$data['seller_flag']?'selected':''; ?>>蓝</option>
								   <option value="5" <?php echo "5"==$data['seller_flag']?'selected':''; ?>>紫</option>
                               	</select> 
								 
								
							
							    <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>-->
                                
                                <input type='hidden' id='kuaidi1' name='kuaidi1' value='{$kuaidi1}' />
                                <input type='hidden' id='kuaidi2' name='kuaidi2' value='{$kuaidi2}' />
                                 
								<!--<a class="btn btn-white btn-sm " href="javascript:window.location.reload(true);" data-toggle="tooltip" data-placement="left"   title="刷新"> <i class="glyphicon glyphicon-repeat"></i> 刷新</a>  -->
                                 <button type="submit" class="btn btn-sm btn-default danxuan" va=""> 全部（{$dan_count['count']}） </button>
                                 <button type="submit" class="btn btn-sm btn-primary danxuan" style="margin-left:10px;" va='weida'> 未打快递单（{$dan_count['weida']}）  </button>
                                 <button type="submit" class="btn btn-sm btn-default danxuan" style="margin-left:10px;"  va='yida'> 已打（{$dan_count['yida']}） </button>
                                 <!--<button type="button" class="btn btn-sm btn-default danxuan" style="margin-left:10px;"> 已 锁 定</button>-->
                                 <button type="submit" class="btn btn-sm btn-default danxuan" style="margin-left:10px;" va='tuikuan'> 退款中（{$dan_count['tuikuan']}）</button>
                                
                                 <span style="padding-left:30px; font-weight:700;">关 键 字&nbsp;  </span> <input class="form-control input-sm" placeholder="旺旺/快递单号/商品简称/编码/省份" name="sou_key" id="sou_key" value="<?php echo empty($sou_key)?'':$sou_key; ?>" style="width:350px;">
							     <button type="submit" class="btn btn-sm btn-primary" style="margin-left:10px;"> 高 级 搜 索 </button>
                            </div>
                            <div class='search' style="margin-top:10px; height:30px;" >
                            	 <div id="shaixuan" style="float:left; font-size:16px; font-weight:700;">
                                 
                                 	<button type="submit"   class="btn btn-sm btn-primary zdy_shai" id="alls"  value="0" vol='all'>  全部（{$duo_count['count']}） </button>
                                 	<button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;" value="0" vol='beizhu'> 有留言或备注（{$duo_count['beizhu']}）</button>
                                   <!-- <button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;"> 无 留 言 备 注 （ ） </button>-->
                                    <!--<button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;"> 一 种 一 件 （ ） </button>
                                    <button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;"> 一 种 多 件 （ ） </button>
                                    <button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;"> 多 种 一 件 （ ） </button>
                                    <button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;"> 多 种 多 件 （ ） </button>-->
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;" value="0" vol='baoyou'>  包邮（{$duo_count['baoyou']}）</button>
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;" value="0" vol='bubao'>  不包邮（{$duo_count['bubao']}）</button>
                                   <!-- <button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;"> 已 合 并 （ ） </button>-->
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;" value="0" vol='weifukuan'> 未付款（{$duo_count['weifukuan']}）</button>
                                   <!-- <button type="button"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;"> 已 付 款 （ ） </button>-->
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;" value="0" vol='hong'>  <img src="__PUBLIC__/img/flag/op_memo_1.png"> （{$duo_count['hong']}）</button>
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;" value="0" vol='huang'>  <img src="__PUBLIC__/img/flag/op_memo_2.png"> （{$duo_count['huang']}）</button>
                                   	<button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;" value="0" vol='lv'>  <img src="__PUBLIC__/img/flag/op_memo_3.png"> （{$duo_count['lv']}）</button>
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;" value="0" vol='lan'>  <img src="__PUBLIC__/img/flag/op_memo_4.png"> （{$duo_count['lan']}）</button>
                                    <button type="submit"   class="btn btn-sm btn-default zdy_shai" style="margin-left:-7px; border-left:1px solid #FFF;" value="0" vol='zi'>  <img src="__PUBLIC__/img/flag/op_memo_5.png"> （{$duo_count['zi']}）</button>
                                    
                                 </div>
                                 <div style="float:right; margin-right:100px;">
                            	 	<!--<input type="checkbox" name='fuxuan' id="is_checks" value="1"  <?php if($fuxuan == '1'){echo 'checked';} ?>  /> 复 选-->
                                    <!--<button type="submit" class="btn btn-sm btn-primary" style="margin-left:100px;"> 自 定 义 筛 选 条 件 </button>-->
                                    <!--<a  href="javascript:void(0)" style="margin-left:50px; margin-right:100px;" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'" class="btn btn-sm btn-primary" >自 定 义 筛 选 条 件</a>-->
                                    <!--<a  href="javascript:void(0)" style="margin-left:50px; margin-right:100px;" id="gj_click"  class="btn btn-sm btn-primary" >自 定 义 筛 选 条 件</a>-->
                                 </div>
                               
                            </div>
                             
                            <div class='search' style="margin-top:10px;height:30px; ">
                            	<!--<button type="submit" class="btn btn-sm btn-primary"> 全 部 </button>-->
                                	<!--<button type="submit" class="btn btn-sm btn-primary" style="margin-right:20px;"> 智 能 指 定 物 流 </button>-->
                                    <a style=" float:right; margin-right:100px;" id="shezhi"> 常 用 设 置 </a>
                            </div>
                            <div style="display:" id="shezhi_open"  is_open='0'>  
                                <div class='search' style="margin-top:10px; margin-bottom:10px;" >
                                    <div  style=" text-align:center;margin:0px auto;">
                                        <span style="text-align:center;">付 款 超 过 <input type="text"  style="width:30px;"> 小 时 特 殊 显 示 </span>
                                        <a style="margin-left:50px;">  宝 贝 简 称 </a> 
                                        <!--<a style="margin-left:20px;"> 宝 贝 规 格 过 滤 </a>-->
                                      	<!--  <a style="margin-left:20px;"> 多 店 铺 管 理 </a>-->
                                       <!-- <span style="margin-left:50px;"><input class="is_he" type='checkbox' id='merge' checked> 自 动 合 并 订 单</span>-->
                                        <!--<span style="margin-left:20px;"><input class="is_checks" type='checkbox' id='merge' checked> 打 印 赠 品 </span>-->
                                        <span style="margin-left:40px;">
                                            排 序 ：
                                            <select name='asc_sort' class="form-control input-sm" id='asc_sort' style='margin-top:-5px;padding-top:0px'>
                                                <option value='pay_time|desc' <?php if($asc_sort == 'pay_time|desc'){ echo 'selected';}  ?>> 付款倒序 </option>
                                                <option value="pay_time|asc" <?php if($asc_sort == 'pay_time|asc'){ echo 'selected';} ?>> 付款顺序 </option>
                                                <option value="outer_iid|asc" <?php if($asc_sort == 'outer_iid|asc'){ echo 'selected';}  ?>> 商品编码 </option>
                                                <option value="receiver_state|asc" <?php if($asc_sort == 'receiver_state|asc'){ echo 'selected';}  ?>> 省份 </option>
                                                <option value="payment|desc" <?php if($asc_sort == 'payment|desc'){ echo 'selected';}  ?>> 金额 </option>
                                                <!--<option value="2" <?php echo "2"==$data['seller_flag']?'selected':''; ?>>重量倒序</option>
                                                <option value="2" <?php echo "2"==$data['seller_flag']?'selected':''; ?>>重量顺序</option>-->
                                            </select> 
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
					    </form>
						<form id="goodsform" method="post" action="">
                        <table class="table table-bordered table-striped table-hover" id="msg_table">
                            <thead>
                                <tr>
                                <th><input type="checkbox" class="check-all" value="" checked/></th>
									<th>收货人</th>
                                    <th>快递单号</th>
								   	<th>付款时间</th>
									<th>电话</th>
									<th>订单号</th>
									<th>产品编码</th>
									<th>数量</th>
									<th>实发</th>
                                    <th>订单状态</th>
                                    <th>发货状态</th>
									<th>金额</th>
									<th>快递费</th>
									<th>卖家备注</th>
                                    <th>备注旗帜</th>
                                    <th>买家备注</th>
									<th>客服</th>
									<th>店铺名</th>
									<th>审核状态</th>
									
                                </tr>  
                            </thead>
                            <tbody>
                            <foreach name="order_list" item="vo">
                             <foreach name="vo.trades" item="trade" key='kt'>
                               <foreach name="trade.orders" item="order" key="key">
                                <tr>
                                 <input class="oid" type="hidden" name="oid" value="{$order.oid}" />    
                                  <if condition="$kt eq 0 and $key eq 0">
                                    <td rowspan='{$vo.total_count}'>
                                       <input class="i-checks" type="checkbox" name="ids" value="{$vo.mid}" total_count='{$vo.total_count}' trades_count='{$vo.trades_count}' checked/>
                                    </td>
                                    <td rowspan='{$vo.total_count}' class='receiver' title='点击修改'>
                                       {$vo.receiver_name} <if condition=" $vo['orders_refund'] "><span style='background:#F806FD;color:white'>退</span></if>
                                        <br>
                                       <if condition="$vo['wait_merge'] eq 1 ">
                                         <span style='background:red;color:white' class='merge'>待合</span>
                                       </if>
                                       <if condition="$vo['has_merge'] eq 1 ">
                                          <span style='background:#3399FF;color:white' class='split'>已合</span>
                                       </if>
                                       
                                    </td> 
                                    <td rowspan='{$vo.total_count}' class="invoice_no">{$trade.invoice_no}</td> 
                                  </if>
                                  <if condition="$key eq 0">
                                    <input class="tid" type="hidden" name="tid" value="{$vo.tid}" />
                                    <td rowspan='{$trade.orders_count}'>{$trade.pay_time}</td>
                                    <td rowspan='{$trade.orders_count}'>
                                        <if condition=" !empty($vo['receiver_mobile'])"> 
                                           {$trade.receiver_mobile} 
                                        <else/>
                                           {$vo.receiver_phone}
                                        </if>  </td>
                                    <td rowspan='{$trade.orders_count}' style="color:<?php echo $order['oid']==$order['tid']?'':'red' ?>" class="<?php echo $trade['orders_count']>1?'part_split':'' ?>">{$trade.tid}
                                    	<if condition=" $order['oid']!=$order['tid']"> 
                                    		<br/><span style='background:#3399FF;color:white'>拆分</span>
                                        </if>
                                    </td>
                                  </if>
                                    <td>{$order.outer_iid} </td>      
                                    <td>{$order.num}</td>
                                    <td class='' nameval='shifa' width='50px'>{$order.shifa}</td>
                                     <td rowspan='{$trade.orders_count}'>{$order.status_name}</td>
                                    <td class='send_status'>{$order.send_status_name}</td> 
                                   
                                  <if condition="$key eq 0">
                                    <td rowspan='{$trade.orders_count}'>{$trade.payment}</td> 
                                    
                                    <td rowspan='{$trade.orders_count}'>{$trade.post_fee}</td>  
                                    <td rowspan='{$trade.orders_count}' class='memo' title='点击修改'>{$trade.seller_memo}</td>
                                    <td rowspan='{$trade.orders_count}' class='memo' title='点击修改'><if condition=" !empty($trade['seller_flag']) "><img src="__PUBLIC__/img/flag/op_memo_{$trade.seller_flag}.png"></if></td>
                                    <td rowspan='{$trade.orders_count}'>{$trade.buyer_memo}</td>
                                    <td rowspan='{$trade.orders_count}'>{$trade.service_name}</td>
                                    <td rowspan='{$trade.orders_count}'>{$trade.shop}</td>
                                    <td rowspan='{$trade.orders_count}'>{$trade.sh_status_name}</td>
                                  
                                  </if>
                                     
                              </tr>
                              </foreach> 
                             </foreach>
                            </foreach>
                          </tbody>
                        </table>
                        <table width="100%">
                          <tr>
                          	<td width="">
                              <select name='template' class="form-control input-sm" id='template' style='padding-top:0px'>
                                   <option value=''>请选择快递</option>
                                   <foreach name="template_list" item="template" >
                                   <option value='{$template.id}' <?php echo $template['name']=='圆通速递_电子面单'?'selected':'' ?> >{$template.name}</option>
                                   </foreach>
                               </select> 
                           </td>
                           <td width="">
                              <select name='address' id='address' class="form-control input-sm" style='padding-top:0px'>
                                   <option value=''>请选择发货地址</option>
                                   <foreach name="address_list" item="address" > 
                                   <option value='{$address.id}' <?php echo $address['is_default']==1?'selected':'' ?> >{$address.full_address}</option>
                                   </foreach>
                               </select> 
                           </td>
                           
                           <!--<td align='center' style='font-size:15px'> 
                               <input type='checkbox' id='merge' checked>合并订单
                           </td> -->
                           <td width="" ><input name='ydh' id='ydh' class="form-control input-sm" placeholder="输入运单号"  width="200px" ></td>
                           <td width=""><input name='chazhi' id='chazhi' class="form-control input-sm" placeholder="差值"  value="1"></td>
						   
						   
							
                           <td><button class="btn btn-sm btn-primary" title="生成快递单号" id="kuaidi" >生成快递单号</button></td>
                           
                           <td><button class="btn btn-sm btn-primary" title="获取电子面单号" id="getdzmd" >获取电子面单号</button></td>
                           
                           <td>
                               <select class="form-control input-sm" style='margin-top:-5px;padding-top:0px' id="PrinterList" size="1"></select>
                           </td>
                           
                           <td align='center' style='font-size:15px'> 
                               <input type='checkbox' id='exclude' checked>排除已打印
                              
                           </td>
                           
                           <td> 
                               <button class="btn btn-sm btn-primary" title="打印快递单" id="check" >打印快递单</button>
                           </td>
                           
                           <td>
                                <span class="btn btn-sm btn-primary" title="发货到淘宝" id="send" >发货到淘宝</span> 
							  <!-- <input type="button" class="btn btn-sm btn-primary"  id="send" value="发货到淘宝" />-->
                           </td>
                            <td><button class="btn btn-sm btn-primary" title="手动审核" id="shenhe" >手动审核</button></td>
                          </tr>
                        </table><br/>
						 
			          </form>
                      
                      
                     	<div id="light" class="white_content"> 
                            <table>
                                <thead>
                                    <th colspan="5"><font style="font-weight:700; font-size:16px;"> 设 置 自 定 义 关 键 字 </font>
                                    <a style=" float:right; text-align:right;"  href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"> 
                                    	关闭
                                    </a>
                                    </th>
                                </thead>
                                <tbody>
                                    <tr >
                                    
                                        <td width="20%"></td>
                                        <td class="zhuyi" style="padding-top:50px;">
                                            <input type="checkbox" class="gj_checks" value="留 言 备 注" zdy='beizhu' /> 留 言 备 注
                                        </td>
                                        <td width="10%"></td>
                                        <td class="zhuyi" style="padding-top:50px; padding-left:20px;">
                                            <input type="checkbox" class="gj_checks" value="旗 帜 标 记"  zdy='biaoji' /> 旗 帜 标 记
                                        </td>
                                        <td width="20%"></td>
                                    </tr>
                                    <tr >
                                        <td width="20%"></td>
                                        <td class="zhuyi" style="padding-top:30px; ">
                                            <input type="checkbox" class="gj_checks" value="商 品 种 类 数 量" zdy='good' /> 商 品 种 类 数 量
                                        </td>
                                         <td width="10%"></td>
                                        <td class="zhuyi" style="padding-top:30px;padding-left:20px;">
                                            <input type="checkbox" class="gj_checks" value="合 并 状 态" zdy='status' />  合 并 状 态
                                        </td>
                                        <td width="20%"></td>
                                    </tr>
                                    <tr >
                                        <td width="20%"></td>
                                        <td class="zhuyi" style="padding-top:30px;">
                                            <input type="checkbox" class="gj_checks" value="有 未 付 款" zdy='pay' />  有 未 付 款
                                        </td>
                                         <td width="10%"></td>
                                        <td class="zhuyi" style="padding-top:30px;padding-left:20px;">
                                            <input type="checkbox" class="gj_checks" value="是 否 包 邮" zdy='post_fee' />  是 否 包 邮
                                        </td>
                                        <td width="20%"></td>
                                    </tr>
                              	</tbody>
                                <tfoot valign="bottom" align="center">
                                	<td style="padding-top:30px;" colspan="5">
                                        <button class="btn btn-sm btn-primary"  id="guanjian" > 确 定 </button>
                                        &nbsp;&nbsp; 
                                       <a  href="javascript:void(0)" class="btn btn-sm btn-primary" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">  取 消 </a>
                                    </td>
                                </tfoot>
                            </table>
                          
                        </div>
                        <div id="fade" class="black_overlay"></div> 
                        
                        
                       
						
	<!-- 分页代码 -->
<div class="fixed-table-pagination" style="display: block;">
	<div class="pull-left pagination-detail">
		<span class="pagination-info">显示第 1 到第 {$count.pageSize} 条记录，总共 {$count.count} 条记录</span>
		<span class="page-list">每页显示 
			<span class="btn-group dropup">
				<button type="button" class="btn btn-default  btn-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
					<span class="page-size">{$count.pageSize}</span> <span class="caret"></span></button>
					<ul class="dropdown-menu" role="menu">
					<li class="<if condition=" $count.pageSize eq 10"> active </if>"><a href="javascript:page(1,10,'');">10</a></li>
					<li class="<if condition=" $count.pageSize eq 25"> active </if>"><a href="javascript:page(1,25,'');">25</a></li>
					<li class="<if condition=" $count.pageSize eq 50"> active </if>"><a href="javascript:page(1,50,'');">50</a></li>
					<li class="<if condition=" $count.pageSize eq 100"> active </if>"><a href="javascript:page(1,100,'');">100</a></li>
					</ul>
					</span> 条记录</span>
				</div>
				<div class="pull-right pagination-roll">
				<ul class="pagination pagination-outline">
					<li class="paginate_button <if condition=" $count.pageNo eq 1"> previous disabled </if>"><a href="javascript:" onClick="page(1,{$count.pageSize},'');"><i class="fa fa-angle-double-left"></i></a></li>
					<li class="paginate_button <if condition=" $count.pageNo eq 1"> previous disabled </if>"><a href="javascript:" onClick="page({$count.pageNo}-1,{$count.pageSize},'');"><i class="fa fa-angle-left"></i></a></li>
					 <if condition=" $count.countpage gt 10 "> 
					 	<if condition=" $count.pageNo lt 5 "> 
							<li class="paginate_button "><a href="javascript:" onClick="page(1,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==1)?'current':'' ?>">1</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(2,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==2)?'current':'' ?>">2</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(3,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==3)?'current':'' ?>">3</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(4,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==4)?'current':'' ?>">4</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(5,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==5)?'current':'' ?>">5</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(6,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==6)?'current':'' ?>">6</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(7,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==7)?'current':'' ?>">7</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(8,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==8)?'current':'' ?>">8</a></li>
							<li class="paginate_button disabled"><a href="javascript:">...</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page({$count.countpage},{$count.pageSize},'');">{$count.countpage}</a></li>
						<elseif condition="$count.pageNo lt $count.num and $count.pageNo egt 5"/>
							<li class="paginate_button "><a href="javascript:" onClick="page(1,{$count.pageSize},'');">1</a></li>
							<li class="paginate_button disabled"><a href="javascript:">...</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['pageNo']-3; ?>,{$count.pageSize},'');"><?php echo $count['pageNo']-3; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['pageNo']-2; ?>,{$count.pageSize},'');"><?php echo $count['pageNo']-2; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['pageNo']-1; ?>,{$count.pageSize},'');"><?php echo $count['pageNo']-1; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page({$count.pageNo},{$count.pageSize},'');" id='current'><?php echo $count['pageNo']; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['pageNo']+1; ?>,{$count.pageSize},'');"><?php echo $count['pageNo']+1; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['pageNo']+2; ?>,{$count.pageSize},'');"><?php echo $count['pageNo']+2; ?></a></li> 
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['pageNo']+3; ?>,{$count.pageSize},'');"><?php echo $count['pageNo']+3; ?></a></li>
							<li class="paginate_button disabled"><a href="javascript:">...</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page({$count.countpage},{$count.pageSize},'');">{$count.countpage}</a></li>
						<else />
							<li class="paginate_button "><a href="javascript:" onClick="page(1,{$count.pageSize},'');">1</a></li>
							<li class="paginate_button disabled"><a href="javascript:">...</a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['countpage']-4; ?>,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==($count['countpage']-4))?'current':'' ?>"><?php echo $count['countpage']-4; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['countpage']-3; ?>,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==($count['countpage']-3))?'current':'' ?>"><?php echo $count['countpage']-3; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['countpage']-2; ?>,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==($count['countpage']-2))?'current':'' ?>"><?php echo $count['countpage']-2; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['countpage']-1; ?>,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==($count['countpage']-1))?'current':'' ?>"><?php echo $count['countpage']-1; ?></a></li>
							<li class="paginate_button "><a href="javascript:" onClick="page(<?php echo $count['countpage']; ?>,{$count.pageSize},'');" id="<?php echo ($count['pageNo']==$count['countpage'])?'current':'' ?>"><?php echo $count['countpage']; ?></a></li>
						</if>
					<else />
						<for start="0" end="$count.countpage" name='i'>
							<li class="paginate_button <if condition=" $count.pageNo eq $i+1"> previous disabled </if>"><a href="javascript:" onClick="page({$i+1},{$count.pageSize},'');" id="<?php echo ($count['pageNo']==($i+1))?'current':'' ?>">{$i+1}</a></li>
						</for>
					</if>
					<li class="paginate_button next <if condition=" $count.pageNo egt $count.countpage"> previous disabled </if>"><a href="javascript:" onClick="page({$count.pageNo}+1,{$count.pageSize},'');"><i class="fa fa-angle-right"></i></a></li>
					<li class="paginate_button next <if condition=" $count.pageNo egt $count.countpage"> previous disabled </if>"><a href="javascript:" onClick="page({$count.countpage},{$count.pageSize},'');"><i class="fa fa-angle-double-right"></i></a></li>
				</ul>
			</div>
		</div>
	<br/>
	<br/>
	</div>
	</div>
</div>


<object id="LODOP_OB" width="0" height="0" style="position:absolute;left:0px;top:-10px;" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"></object>
<object id="LODOP_EM" width="0" height="0" style="position:absolute;left:0px;top:-10px;" type="application/x-print-lodop"></object>

              
                    </div>
                </div>
            </div>
             
        </div>
         
    </div>
   
	
    <script>
		/*$(document).on('click','.zdy_shai',function(){
    		//代码
			$(document).on('click','.zdy_shai',function(){
    		//代码
				$('.zdy_shai').click(function(){
					$('.zdy_shai').each(function(e){
						if($('.zdy_shai').eq(e).hasClass('btn-primary')){
							$('.zdy_shai').eq(e).removeClass('btn-primary').addClass('btn-default');
						}
						$(this).removeClass('btn-default').addClass('btn-primary');
					})
				})
			})
		})
		*/
		
		$('#asc_sort').change(function(){
			$('#searchForm').submit();
		})
		$('.zdy_shai').click(function(){
			if($(this).val()=='0'){     
				var now = $(this).val('1');
			}else{
				 var now = $(this).val('0');
			}
			if($(this).attr("vol") == 'all'){
				if($(this).val() == '1'){
					$('.zdy_shai').each(function(e){
						$(".zdy_shai").eq(e).val('0'); 
					})
					$('#alls').val('1'); 
				}
			}else{  
				$('#alls').val('0');  
			}
			var kuaidi2 = '';
			$('.zdy_shai').each(function(e){
				if($('.zdy_shai').eq(e).val() == '1'){
					kuaidi2 += $('.zdy_shai').eq(e).attr('vol')+',';
				}
			})
			$('#kuaidi2').val(kuaidi2);
		})
		
		$(function($){  
			
			var kuaidi  = $("#kuaidi2").val();
		  	if(kuaidi == ''){
				$('#alls').val('1');
			}else{
				$(".zdy_shai").each(function(e){
					var vol = $(".zdy_shai").eq(e).attr('vol');
					if(kuaidi.indexOf(vol) >= 0){
						$(".zdy_shai").eq(e).val('1'); 
					}
				/*if($(".zdy_shai").eq(e).attr('vol') == kuaidi[i]){
					$(".zdy_shai").eq(e).val('1'); 
				}*/
				
				})
			}
			
		})
		
		
		$('.danxuan').click(function(){
			$('#kuaidi1').val($(this).attr('va'));
		})
		
		
		 
		$('#guanjian').click(function(){
			var str = '<button type="button" class="btn btn-sm btn-primary zdy_shai" Onclick="zdy_shai($(this))"> 全 部 </button>';
			
			$('.gj_checks').each(function(e){
				if($('.gj_checks').eq(e).prop('checked')==true){
					str += ' <button type="button" Onclick="zdy_shai($(this))"  class="btn btn-sm btn-default zdy_shai" style="margin-left:10px;"> '+$('.gj_checks').eq(e).val()+' </button>';
				}
			})
			$('#shaixuan').html(str); 
			$('#light').css('display','none');	
			$('#fade').css('display','none');	
		})
		
		$('#shezhi').click(function(){
			var e = $('#shezhi_open').css('display');
			if(e == 'none'){
				$('#shezhi_open').css('display','');
			}else{
				$('#shezhi_open').css('display','none');
			}
			
		})
	
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
		 $(document).ready(function () {
			var kuaidi1 = $('#kuaidi1').val(); 
			$('.danxuan').each(function(e){
				var danxuan = $('.danxuan').eq(e).attr('va');
				if(kuaidi1 == danxuan){
					$(this).removeClass('btn-default').addClass('btn-primary');
				}else{
					$(this).removeClass('btn-primary').addClass('btn-default');
				}
			})
			$('.zdy_shai').each(function(e){
				if($(".zdy_shai").eq(e).val() == '1' ){
					$(".zdy_shai").eq(e).removeClass('btn-default').addClass('btn-primary');
				}else{
					$(".zdy_shai").eq(e).removeClass('btn-primary').addClass('btn-default');
				}
			})
			 
			$('#gj_click').click(function(){
				$('#light').css('display','block');	
				$('#fade').css('display','block');	
			
			})
			
			
            $('.check-all').iCheck({
			 
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
			
			 $('.is_checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
			$('.gj_checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });
		
	
	$(document).ready(function() {
    $('.check-all').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
    	  $('.i-checks').iCheck('check');
    	});
	
    $('.check-all').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
    	  $('.i-checks').iCheck('uncheck');
    	});
		
		
	$("#shenhe").click(function(e){
		e.preventDefault();
		tids=get_tids();
		
		if(!tids)
		{
			layer.alert('请选择订单！');
			return false;
		}
		
		$.ajax({
			url:"{:U('sd_shenhe')}",    //请求的url地址
			dataType:"json",   //返回格式为script
			data:{"tids":tids},    //参数值
			type:"POST",   //请求方式 
			success:function(res){
				window.location.reload(true);
				/*console.log(res);*/
				
			}
		});
	})
		
		
		
	
	$("#kuaidi").click(function(e){
		 e.preventDefault();
		var template_id=$('#template').val();
		var merge=$('#merge').prop('checked');
		var tids=get_tids();
		var ydh=$('#ydh').val();
		var chazhi=$('#chazhi').val();
		
		var mids=get_mids();
		
		if(!tids)
		{
			layer.alert('请选择订单！');
			return false;
		}
		if(template_id==0)
		{
			layer.alert('请选择快递！');
			return false;
		}
		if(!ydh)
		{
			layer.alert('请输入起始运单号！');
			return false;
		} 
		
		$.ajax({
			url:"{:U('get_ydh')}",    //请求的url地址 
			dataType:"json",   //返回格式为script
			data:{"ydh":ydh,"chazhi":chazhi,"tids":tids,"template_id":template_id,"merge":merge,"mids":mids},    //参数值
			type:"POST",   //请求方式
			success:function(res){
				for(var i = 0;i < res.length;i++){
					 $('.i-checks').each(function(){
						var mid = $(this).val();
						if(mid == res[i]['mid']){
							$(this).parents('tr').find(".invoice_no").text(res[i]['invoice_no']);
						}  
					 })
				} 
				 
				//window.location.reload(true);
			}
		});
	})
	
	$("#getdzmd").click(function(e){
		e.preventDefault();
		
		var template_id=$('#template').val();
		var tids=get_tids();
		var merge=$('#merge').prop('checked');
		var address_id=$('#address').val();
		
		var mids=get_mids();
		 
		if(!tids)
		{
			layer.alert('请选择订单！');
			return false;
		}
		if(template_id=='')
		{
			layer.alert('请选择快递！');
			return false;
		}
		if(address_id=='')
		{
			layer.alert('请选择发货地址！');
			return false;
		}
		
		$.ajax({
			url:"{:U('get_dzmd')}",    //请求的url地址
			dataType:"json",   //返回格式为script
			data:{"template_id":template_id,"tids":tids,"merge":merge,"address_id":address_id,"mids":mids},    //参数值
			type:"POST",   //请求方式
			success:function(res){
				if(res.error)
				{
					layer.alert(res.error);
				}
				else
				{
					for(var i = 0;i < res.length;i++){
						 $('.i-checks').each(function(){
							var mid = $(this).val();
							if(mid == res[i]['mid']){
								$(this).parents('tr').find(".invoice_no").text(res[i]['invoice_no']);
							}   
						 })
					} 
					 
					//window.location.reload(true);
				}
				
			}
		});
	})
		
	$('#check').click(function(e){
	   e.preventDefault();
	   
	    var template_id=$('#template').val();
		var printer=$('#PrinterList').val();//打印机
		var exclude=$('#exclude').prop('checked');
		var merge=$('#merge').prop('merge');
		var address_id=$('#address').val();
		 
		var mids=get_mids();
		
		var error='';
		$('.i-checks').each(function(){
			  if($(this).prop('checked') && $(this).parents('tr').find('.invoice_no').text()=='')
			  {
				 //layer.alert('快递单号不能为空');
				 error='快递单号不能为空';
			  } 
		 })
	   
	   if(error!='') 
	   {   
	       layer.alert('快递单号不能为空');
		   return false;
	   } 
	  
	   if(mids==''){ 
			layer.alert('请选择要打印的订单！');return false;
		}
	   if(template_id==0){
		   layer.alert('请选择快递！');return false;
		}
		if(address_id==''){
		   layer.alert('请选择发货地址！');return false;
		}
		
		$.ajax({ 
			url:"{:U('template_print')}",    //请求的url地址
			dataType:"script",   //返回格式为script
			data:{"template_id":template_id,"printer":printer,"mids":mids,"exclude":exclude,"merge":merge,"address_id":address_id},    //参数值
			type:"GET",   //请求方式
			success:function(req){ 
				//LODOP.PREVIEW();
				 
				//LODOP.PRINT();
			}
		});
	}) 
	
	$('#send').click(function(){
		tids=get_tids();
	    mids=get_mids();
		 
		if(!mids)
		{  
			layer.alert('请选择订单！');
			return false;
		}
		
		$.ajax({
			url:"{:U('send_goods')}",    //请求的url地址
			dataType:"json",   //返回格式为script
			data:{"mids":mids},    //参数值
			type:"POST",   //请求方式
			success:function(res){ 
				  $('.oid').each(function(){
					     oid=$(this).val();
						 $(this).parents('tr').find('.send_status').text(res[oid]['send_status']); 
					})
				  
			}   
		}); 
		//return false;
	})
	
	function get_tids()
	{    
	    var tids='';
		$('.i-checks').each(function(){
			if($(this).prop('checked')){
				tids+=$(this).val()+',';
			}
		 })
		 
		 return tids;
	}	
	
	function get_mids()
	{    
	    var mids='';
		$('.i-checks').each(function(){
			if($(this).prop('checked')){
				 mid=$(this).val();
				 oids='';
				 oid_count=$(this).attr('total_count');
				 oid_start=$(this).parents('tbody').find('.oid').index($(this).parents('tr').find('.oid'));
				 oid_end=parseInt(oid_start)+parseInt(oid_count);
				 for(i=oid_start;i<oid_end;i++)
				 {  
					oids+=$(this).parents('tbody').find('.oid').eq(i).val()+',';
				 } 
				
				 mids+=mid+':'+oids+'|'; 
			}
		 })    
		 
		 return mids;
	}	
	
	CreatePrinterList();
	function CreatePrinterList(){
	    if (document.getElementById('PrinterList').innerHTML!="") return;
		LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
		var iPrinterCount=LODOP.GET_PRINTER_COUNT();
		for(var i=0;i<iPrinterCount;i++){

   			var option=document.createElement('option');
   			option.innerHTML=LODOP.GET_PRINTER_NAME(i);
   			option.value=i;
			document.getElementById('PrinterList').appendChild(option);
		};	
	}; 
     
});

 </script>
    <!--<div style="display:none"><script language="javascript" type="text/javascript" src="http://js.users.51.la/17825721.js"></script>-->
<noscript><a href="http://www.51.la/?17825721" target="_blank"><img alt="&#x6211;&#x8981;&#x5566;&#x514D;&#x8D39;&#x7EDF;&#x8BA1;" src="http://img.users.51.la/17825721.asp" style="border:none" /></a></noscript></div>
</body>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<script  type="text/javascript"  src="http://g.tbcdn.cn/sj/securesdk/0.0.3/securesdk_v2.js"  id="J_secure_sdk_v2" data-appkey="23416550"></script>
</html>
